package cn.com.dcsgo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerAdapter;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * MvcConfig
 *
 * @author Dcsgo
 * @since 2025/2/25 15:35
 */
@Configuration
@EnableWebMvc //开启注解驱动
@ComponentScan({"cn.com.dcsgo.controller"})
public class MvcConfig {
//    @Bean
//    public HandlerMapping handlerMapping() {
//        return new RequestMappingHandlerMapping();
//    }
//
//    @Bean
//    public HandlerAdapter handlerAdapter() {
//        return new RequestMappingHandlerAdapter();
//    }
}
/*
使用EnableWebMvc注解后，SpringMVC会在初始化时自动完成对
handlerMapping handlerAdapter 的初始化，包括handlerAdapter
对于处理json的配置
 */
